package com.hmkx.solr.query;


import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.search.QParser;
import org.apache.solr.search.QParserPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author hht
 * @Description 自定义 ParserPlugin
 *
 * <queryParser name="hmkxParser" class="com.hmkx.solr.query.HmkxQueryParserPlugin" />
 * 调用solr api的时候需要制定 defType=hmkxParser
 *
 * @Date 14:21 2019/7/24
 * @Param 
 * @return 
 **/
public class HmkxQueryParserPlugin extends QParserPlugin {
    final static Logger log= LoggerFactory.getLogger(HmkxQueryParserPlugin.class);

    public void init(NamedList args) {

    }

    @Override
    public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
        return  new HmkxParser(qstr,localParams,params,req);
    }
}
